package com.example.lcpharmacy.mapper;

import com.example.lcpharmacy.entity.GoodsInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface GoodsInfoDao {
    List<GoodsInfoEntity> selectGoods();

    /**
     * 根据商品编号查询商品信息
     */
    List<GoodsInfoEntity> selectByGoodCode(@Param("goodsCode") String goodsCode);

    List<GoodsInfoEntity> selectByGoodName(@Param("goodsName") String goodsName);

    List<GoodsInfoEntity> selectByNameAndCode(@Param("goodsCode") String goodsCode,
                                              @Param("goodsName") String goodsName);

    int deleteByCode(@Param("goodsCode") String goodsCode);

    List<GoodsInfoEntity> checkUpdateName(GoodsInfoEntity goodsInfoEntity);

    List<GoodsInfoEntity> checkUpdateCode(GoodsInfoEntity goodsInfoEntity);

    int updateCodeById(GoodsInfoEntity goodsInfoEntity);

    int insertGoodsInfo(GoodsInfoEntity goodsInfoEntity);

    GoodsInfoEntity selectOneGood(GoodsInfoEntity goodsInfoEntity);
}
